﻿<%@ Page Language="C#" MasterPageFile="~/YUIAspNet.Master" AutoEventWireup="True" CodeBehind="ButtonTypeRegular.aspx.cs" Inherits="YUIAspNetDemo.Button.ButtonTypeRegular" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <title>YUIAsp.Net Controls : LiveDemo : Button : Regular Button</title>
    <script type="text/javascript">
        function PushAction(sender, args)
        {   
            alert("You clicked me! I won't post!");
            args.cancel = true; // prevent postback
        }
    </script>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <h1>Regular button</h1>
    
    <p>YUIAsp.Net Button with type set to regular simulates the ASP.NET button. You have postback support, update panel support and also client side code.</p>
    
    <p>You can cancel postbacks with client code:</p>

    <p><yui:Button ID="btnClientSide" ButtonType="Regular" Text="<img src='skin/add.gif' /> No <b>postback</b> please" OnClientClick="PushAction" runat="server" /></p>
    
    <p>Button's postback inside an update panel works like a charm:</p>
        
    <p><asp:UpdatePanel ID="pnl" runat="server">
            <ContentTemplate>
                <yui:Button ID="btnCallback" Text="Postback inside update panel" runat="server" />
                Server time: <asp:Label ID="lblTime" runat="server"></asp:Label>
            </ContentTemplate>
        </asp:UpdatePanel></p>
    
    <p>Button with regular postback:</p>
        
    <p><yui:Button ID="btnPostback" Text="Regular postback" runat="server" /> Server time: <asp:Label ID="lblTimePB" runat="server"></asp:Label></p>
    
</asp:Content>
